<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="../css/header.css">
    <script src="../js/cookie.js"></script>
    <script src="../js/jquery-1.10.1.min.js"></script>
    <script src="../js/cookie.js"></script>
    <script src="../js/interface.js"></script>
</head>

<body>
    <div class="wrap">
        <div class="title">
            <div class="container">
                <div class="title-left">
                    <a href="./index.html">小米商城</a>
                    <span class="sep">|</span>
                    <a href="https://www.miui.com/">MIUI</a>
                    <span class="sep">|</span>
                    <a href="https://iot.mi.com/">IoT</a>
                    <span class="sep">|</span>
                    <a href="https://i.mi.com/">云服务</a>
                    <span class="sep">|</span>
                    <a href="https://airstar.com/home">天星数科</a>
                    <span class="sep">|</span>
                    <a href="https://youpin.mi.com/">有品</a>
                    <span class="sep">|</span>
                    <a href="https://xiaoai.mi.com/">小爱开放平台</a>
                    <span class="sep">|</span>
                    <a href="https://qiye.mi.com/">企业团购</a>
                    <span class="sep">|</span>
                    <a href="https://www.mi.com/aptitude/list/?id=88">资质证照</a>
                    <span class="sep">|</span>
                    <a href="https://www.mi.com/aptitude/list/">协议规则</a>
                    <span class="sep">|</span>
                    <a href="">
                        下载app
                        <span class="appcode">
                            <img src="" alt="">
                            小米商城App
                        </span>
                    </a>
                    <span class="sep">|</span>
                    <a href="https://xiaomishare.mi.com/?from=micom">智能生活</a>
                    <span class="sep">|</span>
                    <a href="javascript:;">Select Location</a>
                </div>
                <div class="title-cart">
                    <a href="">
                        <em class="iconfont-cart iconfont">&#xe600;</em>
                        <em class="cart-hide">购物车</em>
                        <span class="cart-mini-num">(0)</span>
                    </a>
                    <div></div>
                </div>
                <div class="title-right">
                    <a href="http://localhost/2108_php/xmsc/html/login.html">登录</a>
                    <span class="sep">|</span>
                    <a href="http://localhost/2108_php/xmsc/html/login.html">注册</a>
                    <span class="sep">|</span>
                    <a href="">消息通知</a>
                </div>
            </div>
        </div>
        <div class="topBar">
            <div class="container">
                <div class="logo">
                    <a href="./index.html" class="logo_ir" title="小米官网"></a>
                </div>
                <div class="header-nav">
                    <ul class="nav-list">
                        <li class="nav-category">
                            <a href="javascript:;"></a>
                        </li>
                        <li>
                            <a href="./search.html?key=手机">小米手机</a>
                        </li>
                        <li>
                            <a href="./search.html?key=红米">Redmi 红米</a>
                        </li>
                        <li>
                            <a href="./search.html?key=电视">电视</a>
                        </li>
                        <li>
                            <a href="./search.html?key=笔记本">笔记本</a>
                        </li>
                        <li>
                            <a href="./search.html?key=平板">平板</a>
                        </li>
                        <li>
                            <a href="./search.html?key=家电">家电</a>
                        </li>
                        <li>
                            <a href="./search.html?key=路由器">路由器</a>
                        </li>
                        <li>
                            <a href="./search.html?key=手环">智能硬件</a>
                        </li>
                        <li>
                            <a href="javascript:;">服务</a>
                        </li>
                        <li>
                            <a href="javascript:;">社区</a>
                        </li>
                    </ul>
                </div>
                <div class="header-search">
                    <div class="search-box">
                        <input type="text" id="searchName">
                        <i class="iconfont-search iconfont" id="searchBtn">&#xe699;</i>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
<script>
    var user = getCookie("lgc");
    if (user) {
        // tips.innerHTML = `欢迎您,${user} <button onclick="exit()">退出</button>`
        $(".title-right").html(`欢迎您,${user} <button onclick="exit()">退出</button>`);
    }

    $(function () {
        $("#searchBtn").click(function () {
            location.href = "./search.html?key=" + $("#searchName").val();
        })
    })

    function exit() {
        delCookie("lgc");
        location.reload();
    }

</script>

</html>